using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Afrs.Draco.Prms.Client.Proxy;
using Afrs.Prms.DataObject;

namespace 
{
  /// <summary>
  /// Tdocumentexception Test Class
  /// </summary>
  [TestClass]
  public class TestTdocumentexception
  {
    #region Class Variables
    private CdoPrms<DOTdocumentexception>		m_Tdocumentexception;
    private CdoPrmsList<DOTdocumentexception>	m_AllTdocumentexception;
    #endregion

    #region Class Constructors & Destructors
    /// <summary>
    /// Constructs the test
    /// </summary>
    public TestTdocumentexception()
    {
      // Create the data objects
      this.m_Tdocumentexception	= new CdoPrms<DOTdocumentexception>();
      this.m_AllTdocumentexception	= new CdoPrmsList<DOTdocumentexception>();
    }
    #endregion

    #region Class Methods
    /// <summary>
    /// Retrieves all Tdocumentexception data objects
    /// </summary>
    [TestMethod]
    public void TdocumentexceptionRetrieveAll()
    {
      // Set up the data object for list retrieval
      this.m_AllTdocumentexception.DataObject = new DOTdocumentexception();
      this.m_AllTdocumentexception.ListAction = AfrsDOListAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_AllTdocumentexception.PerformAction())
      {
        // Assert the errors
        if (this.m_AllTdocumentexception.Errors.Count > 0) { Assert.Fail(this.m_AllTdocumentexception.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Create a new Tdocumentexception
    /// </summary>
    [TestMethod]
    public void TdocumentexceptionCreate()
    {
      // Set up the data object for creation
      this.m_Tdocumentexception.DataObject.d_id = "Test d_id";
      this.m_Tdocumentexception.DataObject.d_status = "Test d_status";
      this.m_Tdocumentexception.DataObject.d_match = false;
      this.m_Tdocumentexception.DataObject.d_exist = false;
      this.m_Tdocumentexception.DataObject.d_folder = "Test d_folder";
      this.m_Tdocumentexception.DataObject.d_loc = "Test d_loc";
      this.m_Tdocumentexception.DataObject.d_accno = "Test d_accno";
      this.m_Tdocumentexception.DataObject.d_fileno = "Test d_fileno";
      this.m_Tdocumentexception.DataObject.d_doctype = "Test d_doctype";
      this.m_Tdocumentexception.DataObject.d_stand = "Test d_stand";
      this.m_Tdocumentexception.DataObject.d_suburb = "Test d_suburb";
      this.m_Tdocumentexception.DataObject.d_complex = "Test d_complex";
      this.m_Tdocumentexception.DataObject.d_custid = "Test d_custid";
      this.m_Tdocumentexception.DataObject.d_custname1 = "Test d_custname1";
      this.m_Tdocumentexception.DataObject.d_custname2 = "Test d_custname2";
      this.m_Tdocumentexception.DataObject.d_lasttran = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_user = "Test d_user";
      this.m_Tdocumentexception.DataObject.d_goldate = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_mbno = "Test d_mbno";
      this.m_Tdocumentexception.DataObject.d_tdno = "Test d_tdno";
      this.m_Tdocumentexception.DataObject.d_hogno = "Test d_hogno";
      this.m_Tdocumentexception.DataObject.d_onwins = "Test d_onwins";
      this.m_Tdocumentexception.DataObject.d_owninsno = "Test d_owninsno";
      this.m_Tdocumentexception.DataObject.d_lifecomp = "Test d_lifecomp";
      this.m_Tdocumentexception.DataObject.d_lifeno = "Test d_lifeno";
      this.m_Tdocumentexception.DataObject.d_lifecess = "Test d_lifecess";
      this.m_Tdocumentexception.DataObject.d_lifewaiver = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_govtee = "Test d_govtee";
      this.m_Tdocumentexception.DataObject.d_letsure = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_nhbrc = false;
      this.m_Tdocumentexception.DataObject.d_authpmt = false;
      this.m_Tdocumentexception.DataObject.d_gpadate = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_addendum = "Test d_addendum";
      this.m_Tdocumentexception.DataObject.d_notes = "Test d_notes";
      this.m_Tdocumentexception.DataObject.d_releasetype = "Test d_releasetype";
      this.m_Tdocumentexception.DataObject.d_releasereason = "Test d_releasereason";
      this.m_Tdocumentexception.DataObject.d_primaryattorney = "Test d_primaryattorney";
      this.m_Tdocumentexception.DataObject.d_secondaryattorney = "Test d_secondaryattorney";
      this.m_Tdocumentexception.DataObject.d_notifyreturned = false;
      this.m_Tdocumentexception.DataObject.d_releasebatchnumber = 10;
      this.m_Tdocumentexception.DataObject.d_releasebatchclosed = false;
      this.m_Tdocumentexception.DataObject.d_releasedate = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_returndate = DateTime.Now;
      this.m_Tdocumentexception.DataObject.d_primaryattorneyletterreference = "Test d_primaryattorneyletterreference";
      this.m_Tdocumentexception.DataObject.d_secondaryattorneyletterreference = "Test d_secondaryattorneyletterreference";
      this.m_Tdocumentexception.DataObject.d_trackingnumber = "Test d_trackingnumber";
      this.m_Tdocumentexception.DataObject.Action = AfrsDataObjectAction.Create;

      // Perform the action and determine the success
      if (!this.m_Tdocumentexception.PerformAction())
      {
        // Assert the errors
        if (this.m_Tdocumentexception.Errors.Count > 0) { Assert.Fail(this.m_Tdocumentexception.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }

    /// <summary>
    /// Retrieves a specific Tdocumentexception
    /// </summary>
    [TestMethod]
    public void TdocumentexceptionRetrieve()
    {
      // Determine whether the data object needs to be specified
      if (this.m_Tdocumentexception.DataObject.Id == 0)
      {
        // Specify the data object to retrieve
        this.m_Tdocumentexception.DataObject.documentExceptionId = 10;
      }

      // Set up the data object action for retrieval
      this.m_Tdocumentexception.DataObject.Action = AfrsDataObjectAction.Retrieve;

      // Perform the action and determine the success
      if (!this.m_Tdocumentexception.PerformAction())
      {
        // Assert the errors
        if (this.m_Tdocumentexception.Errors.Count > 0) { Assert.Fail(this.m_Tdocumentexception.Errors[0].Message); }
        else { Assert.Fail("Unknown error occurred"); }
      }

      // Return to calling method
      return;
    }
    #endregion
  }
}
